-
Notifications
You must be signed in to change notification settings - Fork 11
Add SwingColorAlphaWidget #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* scijava-ui-swing PR: scijava/scijava-ui-swing#48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added a few comments, didn't do extensive testing.
What's your use case for this widget?
src/main/java/org/scijava/ui/swing/widget/SwingColorAlphaWidget.java
Outdated
Show resolved
Hide resolved
src/main/java/org/scijava/ui/swing/widget/SwingColorAlphaWidget.java
Outdated
Show resolved
Hide resolved
Thanks for looking at it @imagejan! Here's my use case, it's the LabelEditor where I already copied the widget into in order to use it for an interactive command to change the default colors of any open labeling model: |
The button icon was displaying the RGBA value as RGB (see screencast above) - I fixed that now. |
I removed duplicate static methods which were copied into I noticed that the tab reordering of the color chooser is not working - the code comment says it would switch from |
Would it be possible to have a single |
@ctrueden I pushed a version where |
@frauzufall wrote:
You could also use SciJava's
or
... but I don't know if that makes any difference. |
* while the SwingColorWidget was already able to be used for ColorRGBA, is was previously not able to actually propagate the alpha choice of the user * added a widget demo
12d0334
to
c5ef4b0
Compare
This PR makes it possible to use parameters of type
ColorRGBA
. Before, when usingColorRGBA
, theSwingColorWidget
would returnnull
when changing the color becauseColorRGB
cannot be converted toColorRGBA
here.I just quickly copied the
SwingColorWidget
and replacedColorRGB
withColorRGBA
which makes it work (and also possible to assign colors with alpha value). Let me know if there is a cleaner solution and maybe a way to write a test.